/*
 *    Copyright (c) 2018-2025, envpro All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: envpro
 */
package com.iwomy.envpro.platform.controller;

import com.iwomy.envpro.common.core.util.R;
import com.iwomy.envpro.platform.service.LargeScreenService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 数据大屏
 *
 * @author envpro
 * @date 2019-03-31 16:00:20
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/largeScreen")
@Slf4j
public class LargeScreenController {

	@Resource
	private LargeScreenService largeScreenService;


	/**
	 * 设备分组统计
	 *
	 * @return R
	 */
	@Operation(summary = "设备分组统计", description = "设备分组统计")
	@GetMapping("/equipmentGroupingStatistics")
	public R equipmentGroupingStatistics() {
		return R.ok(largeScreenService.equipmentGroupingStatistics());
	}

	/**
	 * 分组报警统计
	 *
	 * @return R
	 */
	@Operation(summary = "分组报警统计", description = "分组报警统计")
	@GetMapping("/groupAlarmStatistics")
	public R groupAlarmStatistics() {
		return R.ok(largeScreenService.groupAlarmStatistics());
	}


	/**
	 * 报警统计
	 *
	 * @return R
	 */
	@Operation(summary = "报警统计", description = "报警统计")
	@GetMapping("/alarmStatistics")
	public R alarmStatistics() {
		return R.ok(largeScreenService.alarmStatistics());
	}

	/**
	 * 报警趋势曲线
	 *
	 * @return R
	 */
	@Operation(summary = "报警趋势曲线", description = "报警趋势曲线")
	@GetMapping("/alarmTrendCurve")
	public R alarmTrendCurve() {
		return R.ok(largeScreenService.alarmTrendCurve());
	}


}
